package com.didispace.service;

import com.didispace.ComputeClientHystrix;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 1、@FeignClient("服务提供者名称")： 这个注解用在接口上去指定服务提供方
 *
 * 2、该注解可以指定fallback时的回调函数；
 *
 *
 *
 * Created by BG294913 on 2017/9/25.
 */

//@FeignClient("compute-service")
@FeignClient(value = "compute-service", fallback = ComputeClientHystrix.class) //指定了fallback处理类
public interface ComputeClient {

    //在接口上用@RequestMapping注解，比较奇特！
    @RequestMapping(value = "/add",method = RequestMethod.GET)
    Integer add(@RequestParam(value = "a") Integer a, @RequestParam(value = "b") Integer b);


}
